package com.xingchi.tornado.test.model.dto;

import com.xingchi.tornado.security.model.IUser;
import lombok.Data;

import java.util.Set;

/**
 * 登录用户DTO
 *
 * @author xiaoya
 * @date 2025/3/10 14:16
 */
@Data
public class UserLoginDTO implements IUser {

    private Long userId;
    private String username;
    private String password;
    private String realName;
    private String email;
    private String mobile;
    private Integer gender;
    private Integer status;
    private Set<String> roles;
    private Set<String> permissions;
    private Long avatar;

    /**
     * 获取用户id
     *
     * @return 用户id
     */
    @Override
    public Long getId() {
        return userId;
    }

    /**
     * 获取用户id与 {@link IUser#getId()} 等同
     *
     * @return 用户id
     */
    @Override
    public Long getUserId() {
        return userId;
    }

    /**
     * 获取用户头像
     *
     * @return 用户头像id
     */
    @Override
    public Long getAvatar() {
        return avatar;
    }

    /**
     * 获取用户手机号
     *
     * @return 用户手机号
     */
    @Override
    public String getMobile() {
        return mobile;
    }

    /**
     * 获取名称
     *
     * @return 名称
     */
    @Override
    public String getName() {
        return username;
    }
}
